package net.htjs.juc.thread;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThreadRunMethod {

    public static void main(String[] args) {
        /**
         * 直接执行Thread的run方法，执行线程为main线程，不是Thread-1线程
         */
        Thread thread = new Thread(() ->{
            log.info("running");
        }, "Thread-1");
        //12:14:40.244 [main] INFO net.htjs.juc.base.ThreadRunMethod - running
        //thread.run();
        //12:15:23.642 [Thread-1] INFO net.htjs.juc.base.ThreadRunMethod - running
        thread.start();
    }


}
